<template>
  <div class="wrap auditContent">
    <div class="list">
      <el-tabs v-model="activeName" type="border-card" @tab-click="val">
        <el-tab-pane label="已审核" name="11">
          <el-table class="table" :data="tableDatas" style="width: 100%">
            <el-table-column align="center" prop="certId" label="单号"></el-table-column>
            <el-table-column align="center" prop="appliType" label="申请人类型">
              <template slot-scope="scope">{{scope.row.appliType?'自然人':'企业/单位申请'}}</template>
            </el-table-column>
            <el-table-column align="center" prop="appName" label="申请人名字"></el-table-column>
            <el-table-column align="center" prop="name" label="业务类型"></el-table-column>
            <el-table-column prop="phone" align="center" label="电话号码"></el-table-column>
            <!-- <el-table-column prop="publicNum" label="业务个数" align="center"></el-table-column> -->
            <!--<el-table-column prop="result" label="审核结果"  align="center"></el-table-column>-->
            <el-table-column prop="operate" label="操作" align="center">
              <template slot-scope="scope">
                <el-link type="primary"  @click="handleEdit(scope.$index, scope.row, true)" icon="el-icon-document">查看详情</el-link>
              </template>
            </el-table-column>
          </el-table>
          <div class="paging">
            <el-pagination
                    background
                    @size-change="handleSizeChange"
                    @current-change="handleCurrentChange"
                    :current-page="pageNum"
                    :page-sizes="[10,20,30]"
                    layout="total, sizes, prev, pager, next, jumper"
                    :total="total"
            ></el-pagination>
          </div>
        </el-tab-pane>
      </el-tabs>
    </div>
  </div>
</template>
<script>
export default {
  data() {
    return {
      path: "",
      value: "",
      // 页每页数据
      pageSize: 10,
      // 当前页
      pageNum: 1,
      // 总数量
      total: 0,
      // 标签nema
      activeName: "11",
      //审核通过列表
      tableDatas: [],
      tableSkip: [],
    };
  },
  methods: {
    handleEdit(index, item, num) {
      console.log(item);
      for (let i = 0; i <= 25; i++) {
        if (i == item.classId) {
          item.classId == 23
            ? (this.path = "businessForm" + 24)
            : (this.path = "businessForm" + i);
        }
      }
      // console.log(this.tableData);
      this.$router.push({
        path: "detail",
        query: { id: item.id, type: Number(this.activeName),class_id:item.classId},
      });
      
    },
    skip(item) {
      let num = item.dan_number;
      this.$http.get(`/trademark/proPublic/skip/${num}`).then((result) => {
        this.request(Number(this.activeName));
      });
    },
    details(item) {
      this.$router.push({
        path: "/detail",
        query: {
          id: item.id,
        },
      });
    },

    handleSizeChange(val) {
      //
      //   this.pageNum = val;
    },
    handleCurrentChange(val) {
      //
      this.pageNum = val;
      this.val();
    },
    val() {
      this.request(Number(this.activeName));
    },
    request(Num =Number(this.activeName)) {
      let url="/trademark/order/findByOrderId";
      let datble;
      this.$http
        .get(url, {
          params: {
            pageSize: this.pageSize,
            pageNum: this.pageNum,
              orderId:this.$route.query.orderId
          },
        })
        .then((result) => {

          if (result.data.code != 200) return;

          this.total = result.data.data.total;
          let data = result.data.data.data;
          // return
          // this.tableData =[]
          // this.tableDatas =[]
          // this.tableSkip =[]
          datble = [];
          datble = data.map((item) => {
            let timer = new Date(item.createTime);
            item.createTime = `${timer.getFullYear()}-${timer.getMonth()}-${timer.getDate()}`;
            return item;
          });
          switch (Num) {
            case 4:
              this.tableData = datble;
              break;
            case 11:
              this.tableDatas = datble;
              break;
            case 5:
              this.tableSkip = datble;
              break;
          }
        });
    },
  },
  mounted() {
    this.request();
  },
};
</script>
<style lang="less">
.wrap {
  width: 100%;
  .table {
    //min-height: 500px;
    .tiao {
      color: #fff;
      text-decoration: none;
    }
  }
}
.el-input__inner {
  height: 32px !important;
  line-height: 32px !important;
}
.el-link{
  font-size: 12px;
}
.auditContent{
  padding: 0 30px;
}
</style>
